package com.lovo.ssc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lovo.ssc.entity.SysOrder;
import com.lovo.ssc.mapper.SysOrderMapper;
import com.lovo.ssc.service.ISysOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单表 服务实现类
 * </p>
 *
 * @author lovo
 * @since 2022-07-08
 */
@Service
public class SysOrderServiceImpl extends ServiceImpl<SysOrderMapper, SysOrder> implements ISysOrderService {

    @Override
    public List<SysOrder> findByItem(String type, String startTime, String endTime) {
        QueryWrapper qw = new QueryWrapper();
        if (type!="" && type!=null){
            qw.like("type",type);
        }
        if (startTime!=""){
            qw.ge("time",startTime);
        }
        if (endTime!=""){
            qw.le("time",endTime);
        }
        if (type==""&&startTime==""&&endTime==""){
            qw=null;
        }
        return baseMapper.selectList(qw);
    }
}
